package com.service.scheduling.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.service.dao.mapper.MemberGradeConfigMapper;
import com.service.dao.model.Member;
import com.service.dao.model.MemberGradeConfig;
import com.service.scheduling.service.MemberGradeConfigService;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.stream.Collectors;


/**
 * @author lisi
 */
@Service("memberGradeService")
public class MemberGradeConfigServiceImpl extends ServiceImpl<MemberGradeConfigMapper, MemberGradeConfig> implements MemberGradeConfigService {


    @Override
    public MemberGradeConfig getMemberGradeConfig(Integer memberGrade) {
        return getById(memberGrade);
    }

    @Override
    public boolean isValidBreedAward(Member member) {


        return false;
    }


    public boolean isTimeLimit() {
        return true;
    }


    @Override
    public Map<Integer, MemberGradeConfig> list2Map() {
        return list().stream().collect(Collectors.toMap(MemberGradeConfig::getId, a -> a));
    }
}
